home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / networke / xfirepow.000 / xfirepow / xfirepower-0.84 / common / struct.h < prev   
C/C++ Source or Header  |  1995-11-22  |  3KB  |  96 lines

  1. #ifndef struct_h
  2. #define struct_h
  3.  
  4. typedef struct {
  5.     unsigned char m_width, m_height;
  6.     char m_name[34];
  7. }
  8.  
  9. mapinfo;
  10.  
  11. /* PDEAD is dead but connected.  PEMPTY is an empty slot. */
  12. enum player_status {
  13.     PDEAD, PALIVE, PEMPTY, POUTFIT
  14. };
  15.  
  16. #define PFHIDDEN 1
  17.  
  18. /* One player struct for every player in the game */
  19. typedef struct {
  20.     int p_num;                  /* this player's # */
  21.     char p_char;                /* The letter used for this player on the player list and in messages */
  22.     int p_x, p_y;               /* real coords */
  23.     unsigned char p_dir;        /* heading */
  24.     int p_status;               /* alive, dead, empty slot, etc */
  25.     int p_flags;                /* misc. flags (eg hidden by trees) */
  26.     int p_speed;                /* speed */
  27.     int p_keys, p_turnok;       /* obsolete */
  28.     int p_expfuse;              /* When this player dies, how long to keep drawing the explosion */
  29.     char p_name[16];            /* his name */
  30.     char p_login[16];           /* his login */
  31.     int p_desspeed;             /* How fast he _wants_ to be going */
  32.     unsigned char p_desdir;     /* what direction he wants to be going */
  33.     long p_updateplayers;       /* flags for which players need to be updated to this player */
  34.     unsigned int p_wins, p_losses, p_kills;     /* various statistics */
  35.     int p_team;                 /* what team he's on */
  36.     int p_carryflag;            /* is he carrying a flag? */
  37.     char p_host[32];            /* the FQDN of his machine */
  38.     int p_damage;               /* how hurt is his tank? */
  39.     int p_ammo;                 /* how many shells he has left */
  40.     int p_fuel;                 /* how much fuel */
  41.     int p_mines;                /* how many mines */
  42.     int p_trees;                /* how many trees */
  43. }
  44.  
  45. player;
  46.  
  47. enum shell_status {
  48.     SDEAD, SALIVE, SEXPLODE
  49. };
  50.  
  51. typedef struct {
  52.     int s_num;                  /* this shell's number */
  53.     int s_owner;                /* who fired it */
  54.     int s_x, s_y;               /* real coords */
  55.     unsigned char s_dir;        /* heading */
  56.     int s_status;               /* active, exploding, or ready to be fired */
  57.     int s_fuse;                 /* how much longer before it fizzles out */
  58. }
  59.  
  60. shell;
  61.  
  62. typedef struct {
  63.     int b_num;                  /* the base's number */
  64.     int b_team;                 /* which team this base belongs to */
  65.     int b_x, b_y;               /* coords */
  66.     int b_numflags;             /* How many flags have been brought back to this base */
  67. }
  68.  
  69. base;
  70.  
  71. typedef struct {
  72.     int f_num;                  /* this flag's number */
  73.     int f_team;                 /* which team owns this flag */
  74.     int f_x, f_y;               /* coords */
  75.     int f_carrier;              /* who is carrying this flag? */
  76.     int f_moved;                /* has this flag moved since the last update? */
  77. }
  78.  
  79. flag;
  80.  
  81. #define MIEMPTY 0
  82. #define MILIVE 1
  83. #define MIEXPLODE 2
  84. typedef struct {
  85.     int mi_num;                 /* this mine's number */
  86.     int mi_status;              /* not active, live, or exploding */
  87.     int mi_fuse;                /* how long to keep drawing the explosion */
  88.     int mi_x, mi_y;             /* coords */
  89.     int mi_owner;               /* who laid this mine? */
  90.     int mi_updated;             /* who has been updated as to this mine's status/location */
  91. }
  92.  
  93. mine;
  94.  
  95. #endif
  96.